<template>
  <div>
    <h2>子组件</h2>
    <h4>{{ toy }}</h4>
    <h4>父给的车: {{ car }}</h4>
    <button @click="fasong">把玩具给父组件</button>
    <!-- <button @click="sendToy(toy)">把玩具给父组件</button> -->
  </div>
</template>

<script setup lang="ts" name="Child">
import { ref } from 'vue'
let toy = ref('奥特曼')
let props = defineProps(['car', 'sendToy'])

const fasong = () => {
  props.sendToy(toy.value)
}

</script>

<style scoped>

</style>